﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;


namespace DAL
{
    public class KetNoiDuLieu
    {

        public static string strcn = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString.ToString();
        public static SqlConnection cn = new SqlConnection(strcn);
        public SqlConnection LayKetNoi()
        {
            if (cn.State == ConnectionState.Closed)
            {
                cn.Open();
                return cn;
            }
            else
                return cn;
        }        
    }
}
